home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Technology Seed / ADC Seed CD - July 1999.toast / Carbon SDK 1.0d10c3 / Sample Code / SimpleText / SimpleText.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-04  |  19.7 KB  |  560 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        SimpleText.h
  3.  
  4.     Contains:    defines input for both .c and .r files.
  5.                 structured so as to compile corrected in both.
  6.  
  7.     Version:    SimpleText 1.4 or later
  8.  
  9.     Written by:    Tom Dowdy
  10.                 DAL = Dave Lyons
  11.  
  12.     Copyright:    © 1993-1997 by Apple Computer, Inc., all rights reserved.
  13.  
  14.     File Ownership:
  15.  
  16.         DRI:                Tom Dowdy
  17.  
  18.         Other Contact:        Jim Negrette
  19.  
  20.         Technology:            Macintosh Graphics Group
  21.  
  22.     Writers:
  23.  
  24.         (dmp)    Dave Polaschek
  25.         (ecs)    Eric Schlegel
  26.         (ted)    Tom Dowdy
  27.         (Gr)    Greg Robbins
  28.         (TD)    Tom Dowdy
  29.  
  30.     Change History (most recent first):
  31.  
  32.     $Log: SimpleText.h,v $
  33.     Revision 1.10  1999/04/12 19:05:28  poon
  34.     Use new Carbon printing reference.
  35.  
  36.     Revision 1.9  1999/04/01 22:50:39  devans
  37.     Add execute item in Edit menu to run applescripts.
  38.     
  39.     Revision 1.8  1999/02/16 00:41:41  christ
  40.     Integrate document proxy icon support
  41.     
  42.     Revision 1.7  1999/02/10 01:01:04  danp
  43.     Adding Andy Carroll's changes so we compile correctly on both X and MacOS 8.5
  44.     
  45.     Revision 1.6  1998/11/25 21:01:21  wilkes
  46.     Removed all GX references.
  47.     
  48.     Revision 1.5  1998/11/11 22:28:58  wilkes
  49.     Fixed various problems caused by the interface changes made by Nitin earlier,
  50.     mostly involving static RoutineDescriptors...
  51.  
  52.     Revision 1.4  1998/10/12 18:59:02  danp
  53.     Modifications to allow cross-compiling and for CarbonLib support. Removed lots of GX stuff
  54.  
  55.     Revision 1.3  1998/09/15 18:59:49  jiarocci
  56.     SimpleText now builds with -DTARGET_CARBON=1. Still needs further cleanup.
  57.     
  58.     Revision 1.2  1998/09/12 23:09:11  voas
  59.     Convince it to work without passing in storage for windows.
  60.  
  61.     Revision 1.1.1.1  1998/03/18 22:56:11  ivory
  62.     Initial checkin of SimpleText.
  63.     
  64.         
  65.         6     8/20/97 4:23 PM Tom Dowdy
  66.         1674136: adjust cursor after select all
  67.         
  68.         5     8/11/97 3:05 PM Tom Dowdy
  69.         rolling in nav services
  70.         
  71.         4     7/30/97 3:41 PM Tom Dowdy
  72.         Live scrolling now
  73.         
  74.         3     7/29/97 6:27 PM Tom Dowdy
  75.         Added appearance
  76.         
  77.         2     7/29/97 2:06 PM Tom Dowdy
  78.         Removed all of the old and boring refs
  79.         
  80.         1     7/28/97 11:20 AM Duane Byram
  81.         first added to Source Safe project
  82.  
  83.         <10>      1/2/97    ecs        added PreMenuAccessProc
  84.          <9>    11/26/96    ecs        support GXGraphics extension; smarter cursor adjustment
  85.          <8>      9/9/96    dmp        add declarations for cross-module functions.
  86.          <7>      1/4/96    ecs        haveThreads
  87.          <6>     12/6/95    ted        adding file type to preflight
  88.          <5>    10/31/95    ted        adding support for high-res pict scaling
  89.          <4>     10/2/95    TD        adding setwtchcursor
  90.          <3>     9/15/95    Gr        Add mContents, cSelectContents, eDocumentHasNoContentsEntries
  91.          <2>     8/22/95    TD        moving enum to simpletext.h
  92.          <1>     8/21/95    TD        First checked in.
  93.         <15>      9/8/94    DAL        Added kMiscStrings for STR#. Added a prototype for HandleEvent
  94.                                     (for handling updates behind modal dialogs). Added a
  95.                                     bumpUntitledCount boolean in WindowDataRecord (Radar #1148458,
  96.                                     1183083).
  97.  
  98. */
  99.  
  100. #ifndef __SIMPLETEXT__
  101. #define __SIMPLETEXT__
  102.  
  103.  
  104. #define kScrollBarSize                15        // size of a scroll bar, in pixels
  105.  
  106. // Internal errors -- WARNING: some also appear in SimpleText.r
  107. #define eActionAlreadyHandled        100        // the action was handled by the object, don't report an error
  108. #define eUserCanceled                101        // user canceled an operation
  109.  
  110. #define eDocumentTooLarge            200        // document too large to be opened
  111. #define eDocumentWrongKind            201        // document cannot be opened by this application
  112. #define eErrorWhileDrawing            202        // error while drawing the document
  113. #define eDocumentContainsPS            203        // document contains PostScript, it may not display properly
  114. #define eMachineToOld                204
  115. #define eDocumentNotModifiable        205        // document can't be modified
  116. #define eDocumentAlreadyOpen        206
  117. #define eDocumentContainsNoPages    207
  118.  
  119. #define eDocumentHasNoContentsEntries 208    
  120.  
  121. // icon IDs -- WARNING: Also appear in SimpleText.r
  122. #define kTextIcon                    129
  123. #define kReadOnlyIcon                130
  124. #define kPICTIcon                    131
  125. #define kStationeryIcon                132
  126.  
  127. // menu and item defines -- define 'MENU' 'MCMD' 'hmnu' and 'STR#' IDs for menus!
  128. #define rMenuBar            128
  129.  
  130. #define    mApple                128
  131. #define    mFile                129
  132. #define    mEdit                130
  133. #define mFont                131
  134. #define mSize                132
  135. #define mStyle                133
  136. #define    mSound                134
  137. #define mVoices                135
  138. #define mContents            136        
  139.  
  140. #define mLastMenu            mContents
  141. #define mNumberMenus        9
  142.  
  143. #define mFontSubMenusStart    200
  144.  
  145. // Command numbers
  146. #define cNull                0
  147. #define cAbout                1
  148. #define cDeskAccessory        2
  149. #define cTypingCommand        3
  150.  
  151. #define cNew                10
  152. #define cOpen                11
  153. #define cClose                12
  154. #define cSave                13
  155. #define cSaveAs                14
  156. #define cPageSetup            15
  157. #define cPrint                16
  158. #define cPrintOneCopy        17
  159. #define cQuit                18
  160.  
  161. #define cUndo                20
  162. #define cCut                21
  163. #define cCopy                22
  164. #define cPaste                23
  165. #define cClear                24
  166. #define cSelectAll            25
  167. #define cFind                26
  168. #define cFindAgain            27
  169. #define cFindSelection        28
  170. #define cReplace            29
  171. #define cReplaceAgain        30
  172. #define cNextPage            31
  173. #define cPreviousPage        32
  174. #define cGotoPage            33
  175.     #define cGotoLast            32767
  176.     #define cGotoFirst            -32767
  177. #define cShowClipboard        34
  178.  
  179. #define cSelectFont            35
  180. #define cSelectFontStyle    36
  181. #define cExecute            37    // for AppleScript
  182.  
  183. #define cSize9                40
  184. #define cSize10                41
  185. #define cSize12                42
  186. #define cSize14                43
  187. #define cSize18                44
  188. #define cSize24                45
  189. #define cSize36                46
  190.  
  191. #define cPlain                50
  192. #define cBold                51
  193. #define cItalic                52
  194. #define cUnderline            53
  195. #define cOutline            54
  196. #define cShadow                55
  197. #define cCondensed            56
  198. #define cExtended            57
  199.  
  200. #define cRecord                60
  201. #define cPlay                61
  202. #define cErase                62
  203. #define cSpeak                63
  204. #define cStopSpeaking        64
  205. #define cSelectVoice        65
  206. #define cSelectVoiceSubMenu    66
  207.  
  208. #define cSelectContents        75        
  209.  
  210. // windows, dialogs, alerts, and other items of that sort
  211. #define kDefaultWindowID        128
  212. #define kSaveChangesWindowID    129
  213. #define kFindWindowID            130
  214. #define kReplaceWindowID        131
  215.     #define iFindEdit                4
  216.     #define iCaseSensitive            5
  217.     #define iWrapAround                6
  218.     #define iReplaceEdit            8
  219.     #define iReplaceAll                9
  220.     
  221. // Error STR# base
  222. #define kErrorBaseID            1000
  223.  
  224. // Help for window STR#
  225. #define kWindowHelpID            2000
  226.     #define iDidTheBalloon                -1
  227.     #define iNoBalloon                    0
  228.     
  229.     #define iHelpActiveScroll            1
  230.     #define iHelpDimHorizScroll            2
  231.     #define iHelpDimVertScroll            3
  232.     #define iHelpGrowBox                4
  233.     #define iHelpGenericContent            5
  234.  
  235.     #define iHelpPictContent            6
  236.     #define iHelpPictSelection            7
  237.     #define iHelpTextContent            8
  238.  
  239. // Miscellaneous strings (STR#)
  240. #define kMiscStrings            3000
  241. #define iFirstNewDocumentTitle    1
  242. #define iHelpMenuCommand        2
  243. #define iSelectAllCommand        3
  244. #define iSelectNoneCommand        4
  245.  
  246. // Patterns used for selections
  247. #define kPatternListID        128
  248.  
  249. // for disabling menu items
  250. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  251. #define NoItems        0b0000000000000000000000000000000
  252. #define MenuItem1    0b0000000000000000000000000000001
  253. #define MenuItem2    0b0000000000000000000000000000010
  254. #define MenuItem3    0b0000000000000000000000000000100
  255. #define MenuItem4    0b0000000000000000000000000001000
  256. #define MenuItem5    0b0000000000000000000000000010000
  257. #define MenuItem6    0b0000000000000000000000000100000
  258. #define MenuItem7    0b0000000000000000000000001000000
  259. #define MenuItem8    0b0000000000000000000000010000000
  260. #define MenuItem9    0b0000000000000000000000100000000
  261. #define MenuItem10    0b0000000000000000000001000000000
  262. #define MenuItem11    0b0000000000000000000010000000000
  263. #define MenuItem12    0b0000000000000000000100000000000
  264. #define MenuItem13    0b0000000000000000001000000000000
  265. #define MenuItem14    0b0000000000000000010000000000000
  266. #define MenuItem15    0b0000000000000000100000000000000
  267. #define MenuItem16    0b0000000000000001000000000000000
  268. #define MenuItem17    0b0000000000000010000000000000000
  269. #define MenuItem18    0b0000000000000100000000000000000
  270. #define MenuItem19    0b0000000000001000000000000000000
  271.  
  272. // Size resource information
  273. #define kPreferredSize        512*1024
  274. #define kMinimumSize        192*1024
  275.  
  276. #ifndef REZ
  277.  
  278.     enum {
  279.         // Keyboard virtual keycode constants
  280.         kHome        = 0x73,
  281.         kEnd        = 0x77,
  282.         kPageUp        = 0x74,
  283.         kPageDown    = 0x79,
  284.         kUpArrow    = 0x7E,
  285.         kDownArrow    = 0x7D,
  286.         kLeftArrow    = 0x7B,
  287.         kRightArrow    = 0x7C,
  288.         kF1            = 0x7A,
  289.         kF2            = 0x78,
  290.         kF3            = 0x63,
  291.         kF4            = 0x76,
  292.     
  293.         kFromTopTipOffset = 20,                        // offset from top/left of balloons
  294.         kFromBottomTipOffset = 7,                    // offset from bottom/right of balloons
  295.         
  296.         kRAMNeededForNew = 64*1024,                    // amount of RAM free before we allow New documents
  297.         kGrowScrollAdjust = 13,                        // amount to cull scroll bar to make room for growbox
  298.         
  299.         kMinDocSize        =     128                        // min window size in pixels
  300.         };
  301.  
  302.     enum
  303.         {
  304.         kMaxWaitTime    =    5*60*60                // maximum time to pass to WaitNextEvent()
  305.         };
  306.         
  307.     struct MachineInfoRec
  308.         {
  309.         Boolean            amInBackground;            // are we running in the background or foreground
  310.         long            documentCount;            // # of new docs we have made
  311.         short            lastBalloonIndex;        // identifier of last balloon we displayed
  312.  
  313.         Boolean            haveQuickTime;            // do we have QuickTime installed?
  314.         Boolean            haveRecording;            // do we have sound input?
  315.         Boolean            haveTTS;                // do we have text to speech?
  316.         Boolean            haveTSM;                // do we have text services?
  317.         Boolean            haveTSMTE;                // have inline support for TE?
  318.         Boolean            haveDragMgr;            // do we have the Drag Manager?
  319.         Boolean            haveThreeD;                // do we have 3D on this machine?
  320.         Boolean            haveAppleGuide;            // do we have AppleGuide?
  321.         Boolean            haveThreads;            // do we have threads?
  322.         Boolean            haveAppearanceMgr;        // do we have appearance manager?
  323.         Boolean            haveProxyIcons;            // do we have document proxy icons?
  324.         Boolean            haveFloatingWindows;    // do we have floating windows?
  325.         
  326.         Boolean            haveNavigationServices;    // do we have Navigation Services?
  327.         };
  328.     typedef struct MachineInfoRec MachineInfoRec, *MachineInfoPtr;
  329.  
  330.     #ifndef CompilingMain
  331.     extern MachineInfoRec     gMachineInfo;
  332.     extern EventRecord        gEvent;
  333.     extern Str255            gFindString, gReplaceString;
  334.     extern Boolean            gWrapAround, gCaseSensitive;
  335.     extern Boolean            gInModalState;
  336.     #endif
  337.     
  338.     
  339.     struct PreflightRecord
  340.         {
  341.         Boolean        continueWithOpen;    // continue with the opening of the window
  342.         Boolean        needResFork;        // create resfork if none exists
  343.         SignedByte    openKind;            // kind of opening of this file
  344.         short        resourceID;            // resource ID of the 'WIND' resource
  345.         Boolean        wantHScroll;        // want a horizontal scroll bar
  346.         Boolean        wantVScroll;        // want a vertical scroll bar
  347.         Boolean        doZoom;                // want window opened large
  348.         long        storageSize;        // data for the window's refCon
  349.         void *        makeProcPtr;        // pointer to the make proc
  350.         OSType        fileType;            // file type of document
  351.         };
  352.     typedef struct PreflightRecord PreflightRecord, *PreflightPtr;
  353.     
  354.     struct LongRect
  355.         {
  356.         long    top;
  357.         long    left;
  358.         long    bottom;
  359.         long    right;
  360.         };
  361.     typedef struct LongRect LongRect;
  362.     
  363.     typedef OSErr     (*PreflightWindowProc) (PreflightPtr pPreflightData);
  364.     typedef OSErr     (*MakeWindowProc) (WindowPtr pWindow, void* refCon);
  365.     typedef OSErr     (*UpdateWindowProc) (WindowPtr pWindow, void* refCon);
  366.     typedef OSErr    (*PreMenuAccessProc) (WindowPtr pWindow, void* refCon);
  367.     typedef OSErr     (*AdjustMenusProc) (WindowPtr pWindow, void* refCon);
  368.     typedef OSErr     (*CloseWindowProc) (WindowPtr pWindow, void* refCon);
  369.     typedef OSErr     (*GetDocumentRectProc) (WindowPtr pWindow, void* refCon, LongRect * documentRectangle, Boolean forGrow);
  370.     typedef OSErr     (*ContentClickProc) (WindowPtr pWindow, void* refCon, EventRecord * event);
  371.     typedef OSErr     (*ScrollContentProc) (WindowPtr pWindow, void* refCon, short deltaH, short deltaV);
  372.     typedef Boolean    (*FilterEventProc) (WindowPtr pWindow, void* refCon, EventRecord * event);
  373.     typedef OSErr    (*ActivateEventProc) (WindowPtr pWindow, void* refCon, Boolean activating);
  374.     typedef OSErr    (*KeyEventProc) (WindowPtr pWindow, void* refCon, EventRecord * event, Boolean isMotionKey);
  375.     typedef OSErr    (*AdjustSizeProc) (WindowPtr pWindow, void* refCon, Boolean *didResize);
  376.     typedef OSErr    (*CommandProc) (WindowPtr pWindow, void* refCon, short commandID, long menuResult);
  377.     typedef OSErr    (*AdjustCursorProc) (WindowPtr pWindow, void* refCon, Point * localMouse, RgnHandle globalRgn);
  378.     typedef OSErr    (*PrintPageProc) (WindowPtr pWindow, void* refCon, Rect* pageRect, long* pageNum);
  379.     typedef OSErr    (*GetBalloonProc) (WindowPtr pWindow, void* refCon, Point *localMouse, short * returnedBalloonIndex, Rect *returnedRectangle);
  380.     typedef OSErr    (*DragTrackingProc) (WindowPtr pWindow, void *refCon, DragReference theDragRef, short message);
  381.     typedef OSErr    (*DragReceiveProc) (WindowPtr pWindow, void *refCon, DragReference theDragRef);
  382.     typedef OSErr    (*DragAddFlavorsProc) (WindowPtr pWindow, void *refCon, DragReference theDragRef);
  383.     typedef long    (*CalculateIdleTimeProc) (WindowPtr pWindow, void* refCon);
  384.     typedef OSErr    (*GetCoachRectangleProc) (WindowPtr pWindow, void* refCon, Rect *pRect, Ptr name);
  385.  
  386.     struct WindowDataRecord
  387.         {
  388.         WindowPtr                theWindow;
  389.         ResType                    windowKind;                // and kind to identify window type
  390.         OSType                    originalFileType;        // original source of file
  391.         AliasHandle                fileAlias;                // alias handle of the file
  392.         FSSpec                    fileSpec;                // file spec of the file
  393.         short                    dataRefNum;                // data fork refNum
  394.         short                    resRefNum;                // res fork refNum
  395.         Boolean                    isWritable;                // can you write to this file?
  396.         Boolean                    bumpUntitledCount;        // does this kind of document use up an "untitled" number?
  397.         Boolean                    openAsNew;                // open as an untitled document?
  398.         Boolean                    changed;                // has content changed?
  399.         Boolean                    documentAcceptsText;    // document allows typing
  400.         Boolean                    dragWindowAligned;        // drag using DragAlignedWindow
  401.         
  402.         // Standard procedure entry points, may be NIL to get default behavior
  403.         PreflightWindowProc        pPreflightWindow;
  404.         MakeWindowProc            pMakeWindow;
  405.         CloseWindowProc            pCloseWindow;
  406.         
  407.         GetDocumentRectProc        pGetDocumentRect;
  408.         ScrollContentProc        pScrollContent;
  409.         AdjustSizeProc            pAdjustSize;
  410.         AdjustCursorProc        pAdjustCursor;
  411.         GetBalloonProc            pGetBalloon;
  412.         DragTrackingProc        pDragTracking;
  413.         DragReceiveProc            pDragReceive;
  414.         DragAddFlavorsProc        pDragAddFlavors;
  415.         
  416.         FilterEventProc            pFilterEvent;
  417.         ActivateEventProc        pActivateEvent;
  418.         UpdateWindowProc        pUpdateWindow;
  419.         PreMenuAccessProc        pPreMenuAccess;
  420.         AdjustMenusProc            pAdjustMenus;
  421.         KeyEventProc            pKeyEvent;
  422.         ContentClickProc        pContentClick;
  423.         CommandProc                pCommand;
  424.         PrintPageProc            pPrintPage;
  425.         CalculateIdleTimeProc    pCalculateIdleTime;
  426.         GetCoachRectangleProc    pGetCoachRectangle;
  427.         
  428.         // controls that the default implementations use
  429.         Handle                    hPageFormat;    // new carbon print record for the page format object (flattened)
  430.         Handle                    hPrintSettings;    // new carbon print record for the print settings object (flattened)
  431.         Boolean                    hasGrow;        // has a grow box?
  432.         Rect                    contentRect;    // content area, minus the scroll bars
  433.         short                    minHSize;        // minimum window X size, 0 default
  434.         short                    minVSize;        // minimum window Y size, 0 default
  435.         ControlHandle            hScroll;        // horizontal scroll bar
  436.         ControlHandle            vScroll;        // vertical scroll bar
  437.         short                    hScrollAmount;    // amount to scroll in left/right arrow
  438.         short                    vScrollAmount;    // amount to scroll in up/down arrow
  439.         short                    hScrollOffset;    // offset of scrollbar from left side of window
  440.         short                    vScrollOffset;    // offset of scrollbar from top of window
  441.         short                    oldVValue;        // previous vertical value
  442.         short                    oldHValue;        // previous horizontal value
  443.         
  444.         // variables having to do with input support
  445.         TSMTERecHandle            docTSMRecHandle;    // TSM info stored here
  446.         TSMDocumentID            docTSMDoc;            // TSM document id
  447.         
  448.         // Custom data follows here
  449.         };
  450.     typedef struct WindowDataRecord WindowDataRecord, *WindowDataPtr;    
  451.  
  452.     void SetDocumentContentChanged( WindowDataPtr pData, Boolean changed );
  453.  
  454.  
  455.     // Window adjustment routines
  456.     OSErr AdjustScrollBars(WindowPtr pWindow, Boolean moveControls, Boolean didGrow, Boolean *needInvalidate);
  457.     void SetControlAndClipAmount(ControlHandle control, short * amount);
  458.     OSErr DoScrollContent(WindowPtr pWindow, WindowDataPtr pData, short deltaH, short deltaV);
  459.  
  460.     // document rectangle utilities
  461.     void LongRectToRect(LongRect* longRect, Rect *rect);
  462.     void RectToLongRect(Rect *rect, LongRect *longRect);
  463.     void MovableModalDialog(ModalFilterProcPtr filterProc, short * pItem);
  464.     void BeginMovableModal(void);
  465.     void EndMovableModal(void);
  466.     void GetPICTRectangleAt72dpi(PicHandle hPicture, Rect *pictureRect);
  467.     
  468.     // menu command utilities
  469.     void EnableCommand(short commandID);
  470.     void EnableCommandCheck(short commandID, Boolean check);
  471.     void EnableCommandCheckStyle(short commandID, Boolean check, short style);
  472.     void ChangeCommandName(short commandID, short resourceID, short resourceIndex);
  473.     Boolean IsCommandEnabled(short commandID);
  474.  
  475.     // printing utility routines
  476.     OSErr    DoDefault(WindowDataPtr     pData);
  477.     OSErr    DoPageSetup(WindowPtr pWindow);
  478.  
  479.     // event handling routines
  480.     void HandleEvent(EventRecord *);
  481.     void DragAndDropArea(WindowPtr pWindow, WindowDataPtr pData, EventRecord* event, Rect *pFrameRect);
  482.     short ConductFindOrReplaceDialog(short dialogID);
  483.     Boolean PerformSearch(
  484.             Handle    h,                    // handle to search
  485.             long start,                    // offset to begin with
  486.             Str255 searchString,        // string to search for
  487.             Boolean isCaseSensitive,    // case sensitive search
  488.             Boolean isBackwards,        // search backwards from starting point
  489.             Boolean isWraparound,        // wrap search around from end->begining
  490.             long * pNewStart,            // returned new selection start
  491.             long * pNewEnd);            // returned new selection end
  492.  
  493.     // Drag utils
  494.     Boolean IsOnlyThisFlavor(DragReference theDragRef, FlavorType theType);
  495.     Boolean IsDropInFinderTrash(AEDesc *dropLocation);
  496.     Boolean DragText(WindowPtr pWindow, void *pData, EventRecord *pEvent, RgnHandle hilightRgn);
  497.     OSErr TextDragTracking(WindowPtr pWindow, void *pData, DragReference theDragRef, short message);
  498.     OSErr TextDragReceive(WindowPtr pWindow, void *pData, DragReference theDragRef);
  499.     
  500.     // TEClick utilities
  501.     pascal void TextClickLoop(void);
  502.     pascal TEClickLoopUPP GetOldClickLoop(void);
  503.     void AdjustTE(WindowDataPtr pData, Boolean doScroll);
  504.  
  505.     // error utilities
  506.     void ConductErrorDialog(OSErr error, short commandID, short alertType);
  507.  
  508.     // generic utilities
  509.     OSErr DoAdjustCursor(WindowPtr pWindow, Point *where);
  510.     void LocalToGlobalRgn(RgnHandle rgn);
  511.     void GlobalToLocalRgn(RgnHandle rgn);
  512.     void SetWatchCursor(void);
  513.     OSErr SaveCurrentUndoState(WindowDataPtr pData, short newCommandID);
  514.     pascal void MyDrawHook ( unsigned short offset, unsigned short textLen,
  515.             Ptr textPtr, TEPtr tePtr, TEHandle teHdl );
  516.     
  517.     // Preflight routines for the windows we support
  518.     OSErr AboutPreflightWindow(PreflightPtr pPreflightData);
  519.     OSErr PICTPreflightWindow(PreflightPtr pPreflightData);
  520.     OSErr MoviePreflightWindow(PreflightPtr pPreflightData);
  521.     OSErr ClipboardPreflightWindow(PreflightPtr pPreflightData);
  522.     OSErr TextPreflightWindow(PreflightPtr pPreflightData);
  523.     OSErr ThreeDPreflightWindow(PreflightPtr pPreflightData);
  524.     
  525.     // File type routines for the document kinds we support
  526.     void AboutGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  527.     void PICTGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  528.     void MovieGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  529.     void ClipboardGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  530.     void TextGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  531.     void ThreeDGetFileTypes(OSType * pFileTypes, OSType * pDocumentTypes, short * numTypes);
  532.     
  533.     // selection rectangle utilities
  534.     #define MOVESELECTION(X) (((X) & 0x7) == 0x4)
  535.     void DrawSelection(WindowDataPtr pData, Rect *pSelection, short * pPhase, Boolean bumpPhase);
  536.     OSErr SelectContents(WindowPtr pWindow, WindowDataPtr pData, EventRecord *pEvent, Rect *pSelection, Rect *pContent, short *pPhase);
  537.     
  538. #endif
  539.  
  540. // defined window kinds and resource ranges for windows we support
  541. #define kAboutWindow        'ABOT'
  542. #define kAboutBaseID        200
  543.  
  544. #define kPICTWindow            'PICT'
  545. #define kPICTBaseID            300
  546.  
  547. #define kMovieWindow        'MooV'
  548. #define kMovieBaseID        400
  549.  
  550. #define kClipboardWindow    'Clip'
  551. #define kClipboardBaseID    500
  552.  
  553. #define kTextWindow            'TEXT'
  554. #define kTextBaseID            600
  555.  
  556. #define kThreeDWindow        '3DMF'
  557. #define kThreeDBaseID        800
  558.  
  559. #endif
  560.